#include<bits/stdc++.h>
using namespace std;

int main() {
	int ret = 0;
	for(int i = 1; i <= 12; i ++ ) {
		string s;
		cin >> s;
		if(s.size() == i) {
			ret ++ ;
		}
	}
	cout << ret << endl;
	return 0;
}

